package com.yc.blog.ctr;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sun.org.glassfish.gmbal.ParameterNames;
import com.yc.blog.common.HandleMapFactory;
import com.yc.blog.service.HandleServiceAbstract;

@Controller
public class DemoController {

	@RequestMapping("/c1")
	@ResponseBody
	public String c1() {
		System.out.println("--------c1---------");
		return "success";
	}
	
	@RequestMapping("/handle")
	@ResponseBody
	public String handle(String key) {
		HandleServiceAbstract handle = HandleMapFactory.getHandleUtil(key);//根据key找到处理类
		handle.doHandler();//执行具体方法
		
		return "success";
	}
}
